package name.hankc.spring;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.ApplicationContext;

import name.hankc.spring.bean.Cat;
import name.hankc.spring.bean.Dog;

public class ImmediatlyLookup2Application {

  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("basic_dl/quickstart-lazylookup.xml");
    Cat cat = ctx.getBean(Cat.class);
    System.out.println(cat);

    Dog dog = ctx.containsBean("dog") ? (Dog) ctx.getBean("dog") : new Dog();
    System.out.println(dog);
  }

}